function getBoundary(map) {
  const bdary = new BMap.Boundary()
  bdary.get('北京市顺义区', (rs) => {
    var count = rs.boundaries.length
    if (count === 0) {
      return
    }
    const pointArray = []
    for (let i = 0; i < count; i++) {
      const ply = new BMap.Polygon(rs.boundaries[i], {
        strokeWeight: 4,
        strokeColor: '#ff0000',
        fillOpacity: 0.01,
      })
      map.addOverlay(ply) //添加覆盖物
      pointArray = pointArray.concat(ply.getPath())
    }
  })
}

export { getBoundary }
